package cn.kgc.mybatis.mapper;

import cn.kgc.mybatis.entity.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author: mosin
 * @version: v1.0  2022/9/29
 */
public interface DeptMapper {

    @Select("select * from dept")
    List<Dept> getDeptList();

    @Select("select * from dept where deptno = #{deptno} ")
    Dept getOne(Integer deptno);

    @Insert("insert into dept (deptno,dname,loc)values(#{deptno},#{dname},#{loc})")
    Integer addDept(Dept dept);

    @Update("update dept set dname = #{dname} where deptno = #{deptno}")
    Integer updateDept(Dept dept);

    @Delete("delete from dept where deptno = #{deptno}")
    Integer deleteDept(Integer deptno);


}
